<template>
  <div class="container__content__message__msgPanel__content">
    <div
      class="container__content__message__msgPanel__content__items"
      v-for="(item, index) of officeLinkManItem"
      :key="index"
      @click="toChat(item.username)"
    >
      <img
        :src="item.headImg"
        alt=""
        class="container__content__message__msgPanel__content__items__img"
      />
      <div class="container__content__message__msgPanel__content__items__right">
        <div
          class="container__content__message__msgPanel__content__items__right__top"
        >
          {{ item.username }} <span class="type">{{ item.type }}</span>
        </div>
        <div
          class="container__content__message__msgPanel__content__items__right__bottom"
        >
          <div
            class="container__content__message__msgPanel__content__items__right__bottom__left"
          >
            {{ item.msg }}
          </div>
          <div
            class="container__content__message__msgPanel__content__items__right__bottom__right"
          >
            <!-- {{ util.utc2beijing(item.currentTime).split(" ")[1] }} -->
            19:35:00
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
import storage from "../../../utils/storage";
import util from "../../../utils/util";
const officeLinkManItem = ref([]);
const userInfo = storage.getItem("userInfo");
const router = useRouter();
officeLinkManItem.value = userInfo?.friends;
function toChat(name) {
  router.push(`/mailList/chat/${name}`);
}
</script>
<style lang="scss" scoped>
.container__content__message__msgPanel__content {
  &__items {
    display: flex;
    padding: 10rem;
    margin-bottom: 20rem;
    &__img {
      width: 68rem;
      height: 68rem;
      border-radius: 50%;
    }
    &__right {
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      width: 300rem;
      margin-left: 20rem;
      &__top {
        font-size: 16rem;
        font-weight: bold;
        & span.type {
          font-size: 14rem;
          color: #919191;
          margin-left: 10rem;
        }
      }
      &__bottom {
        width: 330rem;
        font-size: 14rem;
        color: #919191;
        display: flex;
        justify-content: space-between;
        &__left {
          width: 180rem;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        &__right {
          width: 120rem;
        }
      }
    }
  }
}
</style>
